/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import java.util.Arrays;
/*     */ import java.util.List;
/*     */ import java.util.stream.Collectors;
/*     */ import javax.script.Invocable;
/*     */ import javax.script.ScriptEngine;
/*     */ import javax.script.ScriptEngineManager;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.gui.GuiMainMenu;
/*     */ import net.minecraft.client.gui.GuiMultiplayer;
/*     */ import net.minecraft.client.gui.GuiOptions;
/*     */ import net.minecraft.client.gui.GuiScreen;
/*     */ import net.minecraft.client.gui.achievement.GuiStats;
/*     */ import net.minecraft.client.gui.advancements.GuiScreenAdvancements;
/*     */ import net.minecraft.realms.RealmsBridge;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class kl
/*     */ {
/*     */   private static ScriptEngine q;
/*     */   private static boolean g;
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"游戏选项", "Minecraft_Options"})
/*     */   public static void y() {
/*  28 */     Minecraft a = Minecraft.func_71410_x();
/*  29 */     a.func_147108_a((GuiScreen)new GuiOptions(null, a.field_71474_y));
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"退出游戏", "Minecraft_Quit"})
/*     */   public static void t() {
/*  36 */     Minecraft a = Minecraft.func_71410_x();
/*  37 */     boolean bool1 = a.func_71387_A();
/*  38 */     boolean bool2 = a.func_181540_al();
/*  39 */     a.field_71441_e.func_72882_A();
/*  40 */     a.func_71403_a(null);
/*  41 */     if (bool1) {
/*  42 */       a.func_147108_a((GuiScreen)new GuiMainMenu());
/*  43 */     } else if (bool2) {
/*  44 */       RealmsBridge realmsBridge = new RealmsBridge();
/*  45 */       realmsBridge.switchToRealms((GuiScreen)new GuiMainMenu());
/*     */     } else {
/*  47 */       a.func_147108_a((GuiScreen)new GuiMultiplayer((GuiScreen)new GuiMainMenu()));
/*     */     } 
/*     */   }
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"关闭游戏", "Minecraft_Shutdown"})
/*     */   public static void h() {
/*  54 */     Minecraft a = Minecraft.func_71410_x();
/*  55 */     a.func_71400_g();
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"游戏进度", "Minecraft_Advancements"})
/*     */   public static void z() {
/*  60 */     Minecraft a = Minecraft.func_71410_x();
/*  61 */     a.func_147108_a((GuiScreen)new GuiScreenAdvancements(a.field_71439_g.field_71174_a.func_191982_f()));
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"游戏统计", "Minecraft_Stat"})
/*     */   public static void v() {
/*  66 */     Minecraft a = Minecraft.func_71410_x();
/*  67 */     a.func_147108_a((GuiScreen)new GuiStats(null, a.field_71439_g.func_146107_m()));
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"设置界面尺寸", "Minecraft_Set_Gui_Scale"})
/*     */   public static void v(int a) {
/*  72 */     Minecraft minecraft = Minecraft.func_71410_x();
/*  73 */     minecraft.field_71474_y.field_74335_Z = a;
/*  74 */     minecraft.field_71474_y.func_74303_b();
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取FPS", "Minecraft_Get_FPS"})
/*     */   public static int v() {
/*  79 */     return Minecraft.func_175610_ah();
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"加载JS", "JS_Load"})
/*     */   public static boolean v() {
/*     */     try {
/*  88 */       if (q == null) {
/*  89 */         ScriptEngineManager a = new ScriptEngineManager(ClassLoader.getSystemClassLoader());
/*  90 */         q = a.getEngineByName("nashorn");
/*     */       } 
/*  92 */       return true;
/*  93 */     } catch (Exception a) {
/*  94 */       return false;
/*     */     } 
/*     */   }
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"设置材质包"})
/*     */   public static void v(String[] a) {
/* 101 */     Minecraft minecraft = Minecraft.func_71410_x();
/* 102 */     minecraft.field_71474_y.field_151453_l.clear();
/* 103 */     minecraft.field_71474_y.field_151453_l.addAll(Arrays.asList(a));
/* 104 */     minecraft.field_71474_y.func_74303_b();
/* 105 */     minecraft.func_175603_A();
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"执行JS", "JS_EXECUTE"})
/*     */   public static o v(String a, o... arrayOfO) {
/* 116 */     Object[] arrayOfObject = Arrays.<o>stream(arrayOfO).map(a -> { if (a instanceof nf) { nf nf = (nf)a; return nf.v().stream().map(o::z).collect(Collectors.toList()); }  return a.z(); }).toArray();
/*     */     
/* 118 */     return v(a, arrayOfObject);
/*     */   }
/*     */   
/*     */   public static o v(String a, Object... arrayOfObject) {
/* 122 */     if (q == null) {
/* 123 */       return ah.v("error! engine is null");
/*     */     }
/*     */     try {
/* 126 */       q.put("base", new Base());
/* 127 */       q.eval(a);
/* 128 */       Invocable invocable = (Invocable)q;
/* 129 */       Object object = invocable.invokeFunction("execute", arrayOfObject);
/* 130 */       return v(object);
/*     */     }
/* 132 */     catch (Exception exception) {
/* 133 */       exception.printStackTrace();
/* 134 */       return ah.v("error! Exception on log");
/*     */     } 
/*     */   }
/*     */ 
/*     */   
/*     */   public static o v(Object a) {
/* 140 */     if (a instanceof Boolean)
/* 141 */       return xk.v(a); 
/* 142 */     if (a instanceof String)
/* 143 */       return ah.v((String)a); 
/* 144 */     if (a instanceof Number)
/* 145 */       return xk.v(a); 
/* 146 */     if (a instanceof List) {
/* 147 */       List list = (List)a;
/* 148 */       List<o> list1 = (List)list.stream().map(kl::v).collect(Collectors.toList());
/* 149 */       return new nf(list1);
/*     */     } 
/* 151 */     return ah.v(a.toString());
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\kl.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */